package com.iwhalecloud.bss.kite.cucc.order.accept.chain.impl;

import com.iwhalecloud.bss.kite.cucc.order.accept.chain.AbstractOrderHandler;
import com.iwhalecloud.bss.kite.order.client.api.operate.IWithdrawOrderService;
import com.iwhalecloud.bss.kite.order.client.dto.OrderRequest;
import com.iwhalecloud.bss.kite.order.client.dto.WithdrawOrderRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class WithdrawOrderHandler extends AbstractOrderHandler {

    @Autowired
    private IWithdrawOrderService withdrawOrderService;

    @Override
    public void doHandle(OrderRequest request) {
        if (request instanceof WithdrawOrderRequest) {
            WithdrawOrderRequest orderRequest = (WithdrawOrderRequest) request;
            withdrawOrderService.withdrawAsk(orderRequest);
        }
    }
}
